package nl.scalasim

import scala.actors.Actor

/**
 * Base class for all actors within the simulation
 *
 * @author Yigal Duppen
 * @since Sep 6, 2010
 */
abstract class ScalasimActor(val name: String)
  extends Actor
  with LoggingActor {

  /** Handler for Stop messages and unmatched messages. */
  def handleDefault(): PartialFunction[Any, Unit] = {
    case Stop => exit
    case msg => warn("[%s] Ignoring %s".format(name, msg))
  }
}
